import { createStore, applyMiddleware } from 'redux'
import RootReducer from './reducers/root.reducer'
import createSagaMiddleware from 'redux-saga'
// import thunk from 'redux-thunk'
// import logger from './middleware/logger'
// import thunk from './middleware/thunk'
import rootSaga from './saga/root.saga'

window.BASE_URL = 'http://localhost:3005'

const sagaMiddleware = createSagaMiddleware()
export const store = createStore(RootReducer, applyMiddleware(sagaMiddleware))
// 启动saga
sagaMiddleware.run(rootSaga)